package com.jintian.smart.kernel.security.mapper;

import com.jintian.smart.base.api.security.entity.LoginLogEntity;
import com.jintian.smart.base.api.security.form.LoginLogQueryForm;
import com.jintian.smart.base.api.security.view.LoginLogVO;
import com.jintian.smart.kernel.orm.mapper.IBaseExtMapper;
import org.beetl.sql.core.page.PageResult;
import org.beetl.sql.mapper.annotation.Mapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource;

/**
 * 登录日志
 */
@Mapper
@SqlResource("security.LoginLog")
public interface LoginLogMapper extends IBaseExtMapper<LoginLogEntity> {
    /**
     * 分页查询
     *
     * @param queryForm
     * @return LoginLogVO
     */
    PageResult<LoginLogVO> queryByPage(LoginLogQueryForm queryForm);

    /**
     * 查询上一个登录记录
     *
     * @param userId
     * @param userType
     * @return LoginLogVO
     */
    LoginLogVO queryLastByUserId(@Param("userId") Long userId, @Param("userType") Integer userType, @Param("loginLogResult") Integer loginLogResult);
}
